﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Admin_Modules_Permision_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div>
        <h3>
            RolesActionsPermissions&nbsp;&nbsp;&nbsp;<asp:LinkButton ID="lnkAddNew" runat="server" OnClick="lnkAddNew_Click">Thêm</asp:LinkButton></h3>
        
        <fieldset>
            <legend runat="server" id="legend1">Search</legend>
            <p style="vertical-align: middle">
                Role: <asp:DropDownList ID="ddlRolesName" runat="server"></asp:DropDownList>
                Module: <asp:DropDownList ID="ddlModule" runat="server"></asp:DropDownList>
                Action: <asp:DropDownList ID="ddlAction" runat="server"></asp:DropDownList>
                Permission: <asp:DropDownList ID="ddlPermission" runat="server"></asp:DropDownList>
                <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
                <asp:Button ID="btnCheckRoles" runat="server" onclick="btnCheckRoles_Click" 
                    Text="CheckRoles" />
            </p>
            <asp:Label runat="server" ID="lblError" ForeColor="Red"></asp:Label>
        </fieldset>
        <fieldset runat="server" id="fieldset">
            <legend>Result</legend>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="100%"
                BorderWidth="1px" OnRowCommand="GridView1_RowCommand">
                <Columns>
                    <asp:BoundField DataField="RoleName" HeaderText="RoleName" ReadOnly="True" SortExpression="RoleName" />
                    <asp:TemplateField HeaderText="Action" SortExpression="ActionId">
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%#Eval("ActionId")%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
               <%--     <asp:BoundField DataField="ModuleId" HeaderText="Module" ReadOnly="True" SortExpression="ModuleId" />--%>
                    <asp:TemplateField HeaderText="Module">
                        <ItemTemplate>
                            <%#Eval("ModuleId")%>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    
                    <asp:BoundField DataField="Permissions" HeaderText="Permissions" />
                    <asp:TemplateField >
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkDelete" runat="server" CommandName="DeleteActionRole" CommandArgument='<%#Eval("Id")%>'
                                Text="Delete"></asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle BackColor="#cccccc" />
            </asp:GridView>
        </fieldset>
    </div>
</asp:Content>

